package com.autism.thread;

/**
 * 避免了单继承的局限性
 * 增强了程序的扩展性（实现runnable接口方式。把设置线程任务和开启线程进行了分离）
 * */
public class MyRunnable implements Runnable {
    @Override
    public void run() {
        for (int i = 0; i < 10; i++) {
            System.out.println(Thread.currentThread().getName() + "=>" + i);
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
